import request from '@/utils/request'
import { apiVersion } from '@/config'

// 全部）
export function getAllMarketModels(data) {
  return request({
    url: `/admin/${apiVersion}/marketModel/all`,
    method: 'get',
    data
  })
}
export function getMarketModels(data) {
  return request({
    url: `/admin/${apiVersion}/marketModel`,
    method: 'get',
    data
  })
}
/**
 * 添加
 * @param {} data 
 */
export function addMarketModel(data) {
  return request({
    url: `/admin/${apiVersion}/marketModel`,
    method: 'post',
    data: data
  })
}
/**
 * 删除
 * @param {} data 
 */
export function delMarketModel(data) {
  return request({
    url: `/admin/${apiVersion}/marketModel/${data.id}`,
    method: 'delete',
    data: data
  })
}
/**
 * 更新
 * @param {} data 
 */
export function putMarketModel(data) {
  return request({
    url: `/admin/${apiVersion}/marketModel`,
    method: 'put',
    data: data
  })
}
/**
 * 取得详情
 * @param {*} data 
 */
export function getMarketModelDetail(data) {
  return request({
    url: `/admin/${apiVersion}/marketModel/${data.id}`,
    noLoadding: true,
    method: 'get',
  })
}
